package src.zhuzi.spring.ioc.base;

public class Knight{
	private String name;
	private Weapon weapon;
	public Knight() {
    }
    public Knight(String name,Weapon weapon) {
        this.name = name;
        this.weapon = weapon;
    }
    public void fight() {
        System.out.println(name+"开始攻击啦！");
        weapon.attack();
    }
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Weapon getWeapon() {
		return weapon;
	}
	public void setWeapon(Weapon weapon) {
		this.weapon = weapon;
	}
}